﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ParboiledSharp.lang.roboline.context;

namespace ParboiledSharp.lang.roboline.ast
{
    class Compare:AbstractChunk
    {
        private string _condition;
        public Compare(string condition) {
            _condition = condition;
        }


        public override int Execute(context.ExecContext context)
        {
            Variable second = Variable.fromObject(context.Pop());
            Variable first = Variable.fromObject(context.Pop());
            
            int comparingResult=first.compare(second);
            context.Push(comparingResult);
            return getNextChunkOffset();
        }
    }
}
